package com.study.spark.scala.chapter02

import java.io.ObjectOutputStream
import java.net.Socket

import com.study.spark.scala.test.User


object Scala06_Master_Object {

  def main(args: Array[String]): Unit = {
    // TODO 客户端
    val client = new Socket("localhost",9999)
    val user = new User
    val out = new ObjectOutputStream(client.getOutputStream)

    out.writeObject(user)
    out.flush()
    out.close()

    println("向服务器发送数据")
    client.close()

  }
}
